package com.example.common.networkutil

import com.example.common.tools.LogUtils
import com.example.common.tools.TooldUtils
import com.example.common.tools.toast
import io.reactivex.functions.Consumer

class ThrowConsumer : Consumer<Throwable>{
    override fun accept(it: Throwable?) {
        TooldUtils.dismissLoading()
        var error = when(it?.message){
            "timeout" -> "连接超时！请稍后重试！"
            else -> it?.message
        }
        LogUtils.eLog("Net", "getTransformList ----> $error")
        "请求异常 ：$error".toast()
    }
}

